/* 
 *  VoyageData
 *
 *  VoyageData is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Foobar is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY ); without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 **********************************************************************************
 *  WARNING: THIS CODE WAS GENERATED DO NOT MODIFY, CHANGE THE XSD INSTEAD
 *  Generated by schema2code on Tue Jun 14 15:34:00 2016.
 **********************************************************************************
 *  Copyright 2010
 *
 */

#ifndef __VOYAGEDATA_H__
#define __VOYAGEDATA_H__

#include <QObject>
#include <QString>
#include <QDateTime>
#include "IVEFWaypoint.h"

class XmlStreamReader;

namespace ivef {

//-----------------------------------------------------------
//! \brief       Class definition of VoyageData
//!
//! DATA regarding a movement of a vessel servers domain
//!
class VoyageData : public QObject { 
    Q_OBJECT

public:
    //! constructor
    //!
    VoyageData();
    //! constructor for parser function
    //!
    VoyageData(XmlStreamReader&);
    //! copy constructor
    //!
    VoyageData(const VoyageData&);
    //! = operator
    //!
    VoyageData & operator=(const VoyageData& val);
    //! == operator
    //!
    bool operator==(const VoyageData& val);
    //! removes a Waypoint.
    //!
    bool removeWaypoint(const Waypoint& val);

    //! adds a Waypoint.
    //!
    bool addWaypoint(const Waypoint& val);

    //! gets the i-th Waypoint.
    //!
    const Waypoint& getWaypointAt(int i) const;

    //!              return the number of Waypoint objects.
    //!
    //! \return     int
    int countOfWaypoints() const;

    //! sets the AirDraught: Actual air draught of the vessel in meters
    //!
    bool setAirDraught(float val);

    //! gets the AirDraught: Actual air draught of the vessel in meters
    //!
    //! \return     float
    //!
    float getAirDraught() const;

    //! returns true if AirDraughtis used (optional field).
    //!
    //! \return     bool
    bool hasAirDraught() const;

    //! sets the Id: The unique identification of this voyagedata. Valid from first message with TrackStatus!=Terminated to first message with TrackStatus=Terminated
    //!
    bool setId(int val);

    //! gets the Id: The unique identification of this voyagedata. Valid from first message with TrackStatus!=Terminated to first message with TrackStatus=Terminated
    //!
    //! \return     int
    //!
    int getId() const;

    //! sets the CargoTypeIMO: 0 = All ships of this type\n
    //! 1 = Carrying DG, HS, or MP, IMO hazard or pollutant category A\n
    //! 2 = Carrying DG, HS, or MP, IMO hazard or pollutant category B\n
    //! 3 = Carrying DG, HS, or MP, IMO hazard or pollutant category C\n
    //! 4 = Carrying DG, HS, or MP, IMO hazard or pollutant category D\n
    //! 5 = Carrying DG, HS, or MP, IMO hazard or pollutant of unknown category
    //!
    bool setCargoTypeIMO(int val);

    //! gets the CargoTypeIMO: 0 = All ships of this type\n
    //! 1 = Carrying DG, HS, or MP, IMO hazard or pollutant category A\n
    //! 2 = Carrying DG, HS, or MP, IMO hazard or pollutant category B\n
    //! 3 = Carrying DG, HS, or MP, IMO hazard or pollutant category C\n
    //! 4 = Carrying DG, HS, or MP, IMO hazard or pollutant category D\n
    //! 5 = Carrying DG, HS, or MP, IMO hazard or pollutant of unknown category
    //!
    //! \return     int
    //!
    int getCargoTypeIMO() const;

    //! returns true if CargoTypeIMOis used (optional field).
    //!
    //! \return     bool
    bool hasCargoTypeIMO() const;

    //! sets the ContactIdentity: reference to the identity associated with this objects voyage
    //!
    bool setContactIdentity(QString val);

    //! gets the ContactIdentity: reference to the identity associated with this objects voyage
    //!
    //! \return     QString
    //!
    QString getContactIdentity() const;

    //! returns true if ContactIdentityis used (optional field).
    //!
    //! \return     bool
    bool hasContactIdentity() const;

    //! sets the DestCode: Destination of the target (UN/LOCODE)  optionally addended with local location code (e.g. BEANR0170100497 = Antwerp, HANSADOK 497)
    //!
    bool setDestCode(QString val);

    //! gets the DestCode: Destination of the target (UN/LOCODE)  optionally addended with local location code (e.g. BEANR0170100497 = Antwerp, HANSADOK 497)
    //!
    //! \return     QString
    //!
    QString getDestCode() const;

    //! returns true if DestCodeis used (optional field).
    //!
    //! \return     bool
    bool hasDestCode() const;

    //! sets the DestName: Destination name of the target e.g. local code for berth/lock/bridge/terminal
    //!
    bool setDestName(QString val);

    //! gets the DestName: Destination name of the target e.g. local code for berth/lock/bridge/terminal
    //!
    //! \return     QString
    //!
    QString getDestName() const;

    //! returns true if DestNameis used (optional field).
    //!
    //! \return     bool
    bool hasDestName() const;

    //! sets the DepartCode: Departure of the target (UN/LOCODE)  optionally addended with local location code (e.g. BEANR0170100497 = Antwerp, HANSADOK 497)
    //!
    bool setDepartCode(QString val);

    //! gets the DepartCode: Departure of the target (UN/LOCODE)  optionally addended with local location code (e.g. BEANR0170100497 = Antwerp, HANSADOK 497)
    //!
    //! \return     QString
    //!
    QString getDepartCode() const;

    //! returns true if DepartCodeis used (optional field).
    //!
    //! \return     bool
    bool hasDepartCode() const;

    //! sets the DepartName: Departure name of the target e.g. local code for berth/lock/bridge/terminal
    //!
    bool setDepartName(QString val);

    //! gets the DepartName: Departure name of the target e.g. local code for berth/lock/bridge/terminal
    //!
    //! \return     QString
    //!
    QString getDepartName() const;

    //! returns true if DepartNameis used (optional field).
    //!
    //! \return     bool
    bool hasDepartName() const;

    //! sets the Draught: Actual draught of the vessel in meters
    //!
    bool setDraught(float val);

    //! gets the Draught: Actual draught of the vessel in meters
    //!
    //! \return     float
    //!
    float getDraught() const;

    //! returns true if Draughtis used (optional field).
    //!
    //! \return     bool
    bool hasDraught() const;

    //! sets the ETA: Date and time in (subset of ISO 8601) UTC format (YYYY-MM-DDThh:mm:ss.sssZ) of the Expected Time Of Arrival of the target at the destination
    //!
    bool setETA(QDateTime val);

    //! gets the ETA: Date and time in (subset of ISO 8601) UTC format (YYYY-MM-DDThh:mm:ss.sssZ) of the Expected Time Of Arrival of the target at the destination
    //!
    //! \return     QDateTime
    //!
    QDateTime getETA() const;

    //! returns true if ETAis used (optional field).
    //!
    //! \return     bool
    bool hasETA() const;

    //! sets the ATD: Date and time in (subset of ISO 8601) UTC format (YYYY-MM-DDThh:mm:ss.sssZ) of the Actual Time Of Departure of the target
    //!
    bool setATD(QDateTime val);

    //! gets the ATD: Date and time in (subset of ISO 8601) UTC format (YYYY-MM-DDThh:mm:ss.sssZ) of the Actual Time Of Departure of the target
    //!
    //! \return     QDateTime
    //!
    QDateTime getATD() const;

    //! returns true if ATDis used (optional field).
    //!
    //! \return     bool
    bool hasATD() const;

    //! sets the ISPSLevel: The ISPS level of the object (1 = normal, 2 = heightended, 3 = exceptional)
    //!
    bool setISPSLevel(float val);

    //! gets the ISPSLevel: The ISPS level of the object (1 = normal, 2 = heightended, 3 = exceptional)
    //!
    //! \return     float
    //!
    float getISPSLevel() const;

    //! returns true if ISPSLevelis used (optional field).
    //!
    //! \return     bool
    bool hasISPSLevel() const;

    //! sets the OverSizedLength: Length of the target in meter as confirmed by NCA, in case of a convoy of barges
    //!
    bool setOverSizedLength(float val);

    //! gets the OverSizedLength: Length of the target in meter as confirmed by NCA, in case of a convoy of barges
    //!
    //! \return     float
    //!
    float getOverSizedLength() const;

    //! returns true if OverSizedLengthis used (optional field).
    //!
    //! \return     bool
    bool hasOverSizedLength() const;

    //! sets the OverSizedWidth: Width of the target in meter as confirmed by the NCA, in case of a convoy of barges
    //!
    bool setOverSizedWidth(float val);

    //! gets the OverSizedWidth: Width of the target in meter as confirmed by the NCA, in case of a convoy of barges
    //!
    //! \return     float
    //!
    float getOverSizedWidth() const;

    //! returns true if OverSizedWidthis used (optional field).
    //!
    //! \return     bool
    bool hasOverSizedWidth() const;

    //! sets the PersonsOnBoard: The number of persons on board of the object, should equal the sum of crew, passengers and support personel if available
    //!
    bool setPersonsOnBoard(int val);

    //! gets the PersonsOnBoard: The number of persons on board of the object, should equal the sum of crew, passengers and support personel if available
    //!
    //! \return     int
    //!
    int getPersonsOnBoard() const;

    //! returns true if PersonsOnBoardis used (optional field).
    //!
    //! \return     bool
    bool hasPersonsOnBoard() const;

    //! sets the Pilots: Pilot status\n
    //! 0 = unknown\n
    //! 1 = pilot on board\n
    //! 2 = object under remote pilotage\n
    //! 3 = pilot required
    //!
    bool setPilots(float val);

    //! gets the Pilots: Pilot status\n
    //! 0 = unknown\n
    //! 1 = pilot on board\n
    //! 2 = object under remote pilotage\n
    //! 3 = pilot required
    //!
    //! \return     float
    //!
    float getPilots() const;

    //! returns true if Pilotsis used (optional field).
    //!
    //! \return     bool
    bool hasPilots() const;

    //! sets the RouteBound: This object is bound to the route of this voyage
    //!
    bool setRouteBound(bool val);

    //! gets the RouteBound: This object is bound to the route of this voyage
    //!
    //! \return     bool
    //!
    bool getRouteBound() const;

    //! returns true if RouteBoundis used (optional field).
    //!
    //! \return     bool
    bool hasRouteBound() const;

    //! sets the SourceId: Unique identification of the producer  (UN/LOCODE)  in case multiple producers exist on the same LOCODE, the local competent authority can optionally addended this with a local  code (e.g. BE ANR 01 = Antwerp, 01)
    //!
    bool setSourceId(QString val);

    //! gets the SourceId: Unique identification of the producer  (UN/LOCODE)  in case multiple producers exist on the same LOCODE, the local competent authority can optionally addended this with a local  code (e.g. BE ANR 01 = Antwerp, 01)
    //!
    //! \return     QString
    //!
    QString getSourceId() const;

    //! returns true if SourceIdis used (optional field).
    //!
    //! \return     bool
    bool hasSourceId() const;

    //! sets the SourceName: Identification of the originator of this data
    //!
    bool setSourceName(QString val);

    //! gets the SourceName: Identification of the originator of this data
    //!
    //! \return     QString
    //!
    QString getSourceName() const;

    //! sets the SourceType: Source/originator type: 0 = Unknown, 1 = Transponder, 2 = Database (VTS Plan Server), 3 = Manual (VTS Officer), 4 =  Fused,  5 = External Source
    //!
    bool setSourceType(int val);

    //! gets the SourceType: Source/originator type: 0 = Unknown, 1 = Transponder, 2 = Database (VTS Plan Server), 3 = Manual (VTS Officer), 4 =  Fused,  5 = External Source
    //!
    //! \return     int
    //!
    int getSourceType() const;

    //! sets the TankerStatus: Describes the status of the tanker\n
    //! 0 = Non gas free\n
    //! 1 = Gas free\n
    //! 2 = Inert
    //!
    bool setTankerStatus(int val);

    //! gets the TankerStatus: Describes the status of the tanker\n
    //! 0 = Non gas free\n
    //! 1 = Gas free\n
    //! 2 = Inert
    //!
    //! \return     int
    //!
    int getTankerStatus() const;

    //! returns true if TankerStatusis used (optional field).
    //!
    //! \return     bool
    bool hasTankerStatus() const;

    //! sets the Tugs: Object uses tugs
    //!
    bool setTugs(bool val);

    //! gets the Tugs: Object uses tugs
    //!
    //! \return     bool
    //!
    bool getTugs() const;

    //! returns true if Tugsis used (optional field).
    //!
    //! \return     bool
    bool hasTugs() const;

    //! sets the UpdateTime: Date and time in (subset of ISO 8601) UTC format (YYYY-MM-DDThh:mm:ss.sssZ)  this data was compiled
    //!
    bool setUpdateTime(QDateTime val);

    //! gets the UpdateTime: Date and time in (subset of ISO 8601) UTC format (YYYY-MM-DDThh:mm:ss.sssZ)  this data was compiled
    //!
    //! \return     QDateTime
    //!
    QDateTime getUpdateTime() const;

    //! generates XML of this object including attributes and child elements
    //! returns QString::null if not all required elements are available
    //! If null returned check lastError() for problem description
    //!
    //! \return     QString
    const QString& toXML(bool outputNamespace = true);

    //! generates output of this object including attributes and child elements
    //!
    //! \return     QString
    QString toString() const;

    //! generates output of this object including attributes and child elements
    //!
    //! \return     QString
    QString toString(QString lead) const;

    //! return last error found in toXML function
    //!
    //! \return     QString
    const QString& lastError() const;

    //! return changed 
    //!
    //! \return     bool
    const bool& changed() const;

    //! return store 
    //!
    //! \return     QString
    const QString& store() const;


private:
    QList<Waypoint> m_waypoints;
    float m_airDraught;
    bool m_airDraughtPresent;
    int m_id;
    bool m_idPresent;
    int m_cargoTypeIMO;
    bool m_cargoTypeIMOPresent;
    QString m_contactIdentity;
    bool m_contactIdentityPresent;
    QString m_destCode;
    bool m_destCodePresent;
    QString m_destName;
    bool m_destNamePresent;
    QString m_departCode;
    bool m_departCodePresent;
    QString m_departName;
    bool m_departNamePresent;
    float m_draught;
    bool m_draughtPresent;
    QDateTime m_ETA;
    bool m_ETAPresent;
    QDateTime m_ATD;
    bool m_ATDPresent;
    float m_ISPSLevel;
    bool m_ISPSLevelPresent;
    float m_overSizedLength;
    bool m_overSizedLengthPresent;
    float m_overSizedWidth;
    bool m_overSizedWidthPresent;
    int m_personsOnBoard;
    bool m_personsOnBoardPresent;
    float m_pilots;
    bool m_pilotsPresent;
    bool m_routeBound;
    bool m_routeBoundPresent;
    QString m_sourceId;
    bool m_sourceIdPresent;
    QString m_sourceName;
    bool m_sourceNamePresent;
    int m_sourceType;
    bool m_sourceTypePresent;
    int m_tankerStatus;
    bool m_tankerStatusPresent;
    bool m_tugs;
    bool m_tugsPresent;
    QDateTime m_updateTime;
    bool m_updateTimePresent;
    QString m_lastError; 
    bool m_changed; 
    QString m_store;
}; 
} //end ns

#endif
